#pragma once
#include "comm.hpp"
#include "Algorithm.hpp"
#include "Hanoi.hpp"
#include "HuffmanTree.hpp"
#include "QuickSort.hpp"
#include "ChessboardCoverage.hpp"

namespace NS_Factory
{
	class Factory
	{
	public:
		std::shared_ptr<NS_Algorithm::Algorithm> get_object(int id)
		{
			
			std::shared_ptr<NS_Algorithm::Algorithm> obj;
			switch (id)
			{
			case 0:
				obj = std::shared_ptr<NS_Algorithm::Algorithm>(new Hanoi());
				break;
			case 1:
				obj = std::shared_ptr<NS_Algorithm::Algorithm>(new HuffmanTree());
				break;
			case 2:
				obj = std::shared_ptr<NS_Algorithm::Algorithm>(new QuickSort());
				break;
			case 3:
				obj = std::shared_ptr<NS_Algorithm::Algorithm>(new ChessboardCoverage());
				break;
			default:
				assert(false);
				break;
			}
			return obj;
		}
	};
}